package com.jmxcfc.blfsc.common.sms.enums;

/**
 * 消息类型
 * @author pbs
 */
public enum MsgTypeEnum {


    SMS("SMS", "短信"),


    VOICE("VOICE", "语音");


    /**
     * 类型
     */
    private String type;

    /**
     * 描述
     */
    private String desc;

    MsgTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String type() {
        return this.type;
    }

    public String desc() {
        return this.desc;
    }


    /**
     * 根据值  获取 枚举
     * @param type
     * @return
     */
    public static MsgTypeEnum getEnumByValue(String type) {
        MsgTypeEnum[] instances = MsgTypeEnum.values();
        for(MsgTypeEnum instance : instances){
            if(instance.type().equals(type)){
                return instance;
            }
        }
        return null;
    }
}
